home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / honeytrouble.swf / scripts / frame_11 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  2.9 KB  |  114 lines

  1. function addVolume2(snd, _volume)
  2. {
  3.    snd.setVolume(_volume + snd.getVolume());
  4. }
  5. function change_Sound_arr(arr)
  6. {
  7. }
  8. function play_bg_snd(snd_str)
  9. {
  10.    if(bgSnd_bool)
  11.    {
  12.       bg_sound.stop();
  13.       bg_sound.attachSound(snd_str);
  14.       bg_sound.start(0,1000);
  15.       bg_sound.setVolume(20);
  16.    }
  17. }
  18. function rndPlay_bg_snd()
  19. {
  20.    if(bgSnd_bool)
  21.    {
  22.       bg_sound.stop();
  23.       if(levelNum % 7 == 1)
  24.       {
  25.          bg_snd_array.shuffle(cnt % 7);
  26.          if(bg_snd_array[1] == tmp_array_num2)
  27.          {
  28.             bg_snd_array.shift();
  29.             bg_snd_array.push(tmp_array_num);
  30.          }
  31.       }
  32.       tmp_array_num = bg_snd_array[0];
  33.       bg_snd_array.shift();
  34.       bg_snd_array.push(tmp_array_num);
  35.       tmp_array_num2 = bg_snd_array[0];
  36.       var _loc1_ = bg_snd_array[0];
  37.       bg_sound.attachSound(_loc1_);
  38.       trace("ΦâîµÖ»Θƒ│Σ╣É∩╝Ü" + _loc1_);
  39.       bg_sound.start(0,1000);
  40.    }
  41. }
  42. function snd_move_in_start()
  43. {
  44.    moveIn_sound.setVolume(150);
  45.    moveIn_sound.start(0,20);
  46.    moveIn_sound_mc.onEnterFrame = function()
  47.    {
  48.       snd_move_in();
  49.    };
  50. }
  51. function snd_move_in()
  52. {
  53.    if(moveIn_sound.getVolume() > 0)
  54.    {
  55.       addVolume2(moveIn_sound,-2);
  56.    }
  57.    else
  58.    {
  59.       moveIn_sound.stop();
  60.       delete moveIn_sound_mc.onEnterFrame;
  61.    }
  62. }
  63. Sound_con = new Sound();
  64. Sound_con.attachSound("move_in");
  65. moveIn_sound = new Sound(moveIn_sound_mc);
  66. moveIn_sound.attachSound("move_in");
  67. shoot_sound = new Sound(sound_mc);
  68. shoot_sound.attachSound("shoot");
  69. attach_sound = new Sound(sound_mc);
  70. attach_sound.attachSound("attach");
  71. super_attach_sound = new Sound(sound_mc);
  72. super_attach_sound.attachSound("super_attach");
  73. remove_sound = new Sound(sound_mc);
  74. remove_sound.attachSound("remove");
  75. goback_sound = new Sound(sound_mc);
  76. goback_sound.attachSound("goback");
  77. boom_sound = new Sound(sound_mc);
  78. boom_sound.attachSound("boom");
  79. dir_sound = new Sound(sound_mc);
  80. dir_sound.attachSound("dir");
  81. levelUp_sound = new Sound(bg_sound_mc);
  82. levelUp_sound.attachSound("levelUp");
  83. level_pass = new Sound(bg_sound_mc);
  84. level_pass.attachSound("pass");
  85. bg_snd_array = ["bg_1","bg_2","bg_3","bg_4"];
  86. bg_sound = new Sound(bg_sound_mc);
  87. bg_sound.setVolume(80);
  88. var all_sound = ["moveIn_sound","shoot_sound","attach_sound","super_attach_sound","remove_sound","goback_sound","boom_sound","dir_sound","levelUp_sound","bg_sound"];
  89. Array.prototype.shuffle = function(pnum)
  90. {
  91.    if(pnum == undefined)
  92.    {
  93.       pnum = 1;
  94.    }
  95.    var _loc6_ = 0;
  96.    while(_loc6_ < pnum)
  97.    {
  98.       var _loc5_ = this.length;
  99.       var _loc2_ = 0;
  100.       while(_loc2_ < _loc5_)
  101.       {
  102.          var _loc3_ = random(_loc5_);
  103.          var _loc4_ = this[_loc2_];
  104.          this[_loc2_] = this[_loc3_];
  105.          this[_loc3_] = _loc4_;
  106.          _loc2_ = _loc2_ + 1;
  107.       }
  108.       _loc6_ = _loc6_ + 1;
  109.    }
  110. };
  111. bg_snd_array.shuffle();
  112. pro_sound = new Sound(sound_mc);
  113. pro_sound.attachSound("pro");
  114.